package com.zmn.plat.services.impl.channel.workorder.picture;

import com.google.common.collect.Lists;
import com.zmn.plat.model.entity.channel.workorder.picture.ChannelWorkOrderPictureStandard;
import com.zmn.plat.persistence.interfaces.channel.workorder.picture.ChannelWorkOrderPictureStandardDao;
import com.zmn.plat.services.interfaces.channel.workorder.picture.ChannelWorkOrderPictureStandardService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author sunlife
 * @since :2021/10/29 4:41 下午
 * description:
 */
@Service
public class ChannelWorkOrderPictureStandardServiceImpl implements ChannelWorkOrderPictureStandardService {

    @Resource
    ChannelWorkOrderPictureStandardDao channelWorkOrderPictureStandardDao;

    @Override
    public ChannelWorkOrderPictureStandard findByKey(Integer id) {
        return channelWorkOrderPictureStandardDao.selectByPrimaryKey(id);
    }

    @Override
    public List<ChannelWorkOrderPictureStandard> listStandardByRelateId(Integer relateId) {
        return channelWorkOrderPictureStandardDao.listStandardByRelateId(Lists.newArrayList(relateId));
    }

    @Override
    public List<ChannelWorkOrderPictureStandard> listStandardByRelateIds(List<Integer> relateIds) {
        return channelWorkOrderPictureStandardDao.listStandardByRelateId(relateIds);
    }

    @Override
    public int insert(ChannelWorkOrderPictureStandard standard) {
        return channelWorkOrderPictureStandardDao.insert(standard);
    }

    @Override
    public int batchInsert(List<ChannelWorkOrderPictureStandard> standardList) {
        return channelWorkOrderPictureStandardDao.batchInsert(standardList);
    }

    @Override
    public int delete(ChannelWorkOrderPictureStandard standard) {
        return channelWorkOrderPictureStandardDao.deleteByQuery(standard);
    }
}
